package org.opensuse.bs.ui.views;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

public class NonBSProjectFilter extends ViewerFilter {
	
	public boolean select(Viewer viewer, Object parentElement, Object element) {
		if(element instanceof IProject) {
			IProject project = (IProject) element;
			try {
				if(project.hasNature("org.opensuse.bs.ui.bsprojectnature")) {
					return true;
				}
				else {
					return false;
				}
			}catch(CoreException e) {
				e.printStackTrace();
			}
		}
		return true;
	}

}
